/**
 * 应用程序设置相关Store
 */
 import defaultSettings from '@/settings';

 const { isRelease, appTitle, fixedHeader, sidebarLogo, collapseMenu, openedUnique } = defaultSettings;
 
//  const state = {
//      isRelease: true,
//      appTitle: '登录',
//      fixedHeader: false,
//      sidebarLogo: true,
//      collapseMenu: false,
//      openedUnique: true
//  };
const state = {
    isRelease: isRelease,
    appTitle: appTitle,
    fixedHeader: fixedHeader,
    sidebarLogo: sidebarLogo,
    collapseMenu: collapseMenu,
    openedUnique: openedUnique
};
 
 const mutations = {
     CHANGE_SETTING: (state, { key, value }) => { if (Object.prototype.hasOwnProperty.call(state, key)) { state[key] = value; } }
 };
 
 const actions = {
     changeSetting ({ commit }, data) { commit('CHANGE_SETTING', data); }
 };
 
 export default { namespaced: true, state, mutations, actions };